package com.accp.controller;

import com.accp.pojo.Users;
import com.accp.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Title: chaoye
 *
 * @author 范康楷
 * @date 2018/6/5
 */
@Controller
@RequestMapping("/user")
public class UsersController {
    @Autowired
    private UsersService usersService;
    @RequestMapping("getAll")
    public String getAll(Model model){
        List<Users> list = usersService.getAll();
        model.addAttribute("list",list);
        return "index";
    }

}
